package com.manor.main.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 *
 *
 * @date  2020/7/10  14:34
 * @version 1.0
 */
class UserCenterTabAdapter(fm: FragmentActivity, private val fragmentList: List<Fragment>) : FragmentStateAdapter(fm) {

    override fun getItemCount(): Int = fragmentList.size

    override fun createFragment(position: Int): Fragment = fragmentList[position]


}

//class UserCenterTabAdapter(fm: FragmentManager, behavior: Int, private val fragmentList: List<Fragment>)
//    : FragmentPagerAdapter(fm, behavior) {
//    private val titles = listOf("视频", "相册", "社区动态","基本信息")
//
//    override fun getItem(position: Int): Fragment = fragmentList[position]
//
//    override fun getCount(): Int = fragmentList.size
//
//    override fun getPageTitle(position: Int): CharSequence? = titles[position]
//
//}